from typing import *

from math import inf


class Solution:

    def minGroupsForValidAssignment(self, nums: List[int]) -> int:
        cnt = Counter(nums)
        mn = len(nums)
        for k, v in cnt.items():
            if v < mn:
                mn = v
        ans = len(nums)
        for i in range(1, mn + 1):
            c = 0
            for k, num in cnt.items():
                a, b = divmod(num, i + 1)
                if b == 0:
                    c += a
                elif a >= i - b:
                    c += a + 1
                else:
                    c = inf
                    break
            ans = min(ans, c)
        return ans


s = Solution()
print(s.minGroupsForValidAssignment([3, 2, 3, 2, 3]))

arr = [10, 11, 12, 13]
k = 1

case = []
for i in arr:
    for _ in range(i):
        case.append(k)
    k += 1
print(case)

print(divmod(10, 2))
